<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width" />
	<meta name="author" content="www.lzqcode.com" />
    <title>文章阅读</title>
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="layui/css/layui.css" />
    <link rel="stylesheet" href="css/master.css" />
    <link rel="stylesheet" href="css/gloable.css" />
    <link rel="stylesheet" href="css/nprogress.css" />
    <link rel="stylesheet" href="css/blog.css" />
</head>
<body>
    <div class="header">
    </div>
    <header class="gird-header">
        <div class="header-fixed">
            <div class="header-inner">
                <a href="javascript:void(0)" class="header-logo" id="logo">Mr.chen</a>
                <nav class="nav" id="nav">
                    <ul>
                        <li><a href="index.html">首页</a></li>
                        <li><a href="article.html">博客</a></li>
                        <li><a href="message.html">留言</a></li>
						<li><a href="diary.html">日记</a></li>
<!--                        <li><a href="link.html">友链</a></li>-->
                    </ul>
                </nav>
<!--                <a href="#" class="blog-user">-->
<!--                    <i class="fa fa-qq"></i>-->
<!--                </a>-->
                <a class="phone-menu">
                    <i></i>
                    <i></i>
                    <i></i>
                </a>
            </div>
        </div>
    </header>
    <div class="doc-container cbt" id="doc-container">
        <div class="container-fixed">
            <div class="col-content" style="width:100%">
                <div class="inner">
                    <article class="article-list">
                        <input type="hidden" value="@Model.BlogTypeID" id="blogtypeid" />
                        <section class="article-item">
                            <aside class="title" style="line-height:1.5;">
                                <h4>{{blog.title}}</h4>
                                <p class="fc-grey fs-14">
                                    <small>
                                        作者：<a href="javascript:void(0)" target="_blank" class="fc-link">{{blog.writer}}</a>
                                    </small>
                                    <small class="ml10">围观群众：<i class="readcount">{{blog.viewCount}}</i></small>
                                    <small class="ml10">更新于 <label>{{blog.createTime}}</label> </small>
                                </p>
                            </aside>
                            <div class="time mt10" style="padding-bottom:0;">
                                <span class="month fs-18"><small class="fs-14">{{blog.createTime}}</small></span>
                            </div>
                            <div class="content artiledetail" style="border-bottom: 1px solid #e1e2e0; padding-bottom: 20px;">
                                <div v-html="blog.define1" style="width: 100% !important;"></div>
                                <div class="copyright mt20">
                                    <p class="f-toe fc-black" v-if="blog.fileNames">
                                        <a href="javascript:void(0)" v-for="(item,index) in files" @click="downLoadFile(item)">附件{{index+1}}</a>
                                    </p>
<!--                                    <p class="f-toe">-->
<!--                                        本文标题：-->
<!--                                        <a href="javascript:void(0)" class="r-title">Java学习路线推荐</a>-->
<!--                                    </p>-->
<!--                                    <p class="f-toe">-->
<!--                                        本文网址：-->
<!--                                        <a href="#">http://www.lzqcode.com</a>-->
<!--                                    </p>-->
                                </div>
                                <div id="aplayer" style="margin:5px 0"></div>
<!--                                <h6>延伸阅读</h6>-->
<!--                                <ol class="b-relation"></ol>-->
                            </div>
<!--                            <div class="bdsharebuttonbox share" data-tag="share_1">-->
<!--                                <ul>-->
<!--                                    <li class="f-praise"><span><a class="s-praise"></a></span></li>-->
<!--                                    <li class="f-weinxi"><a class="s-weinxi" data-cmd="weixin"></a></li>-->
<!--                                    <li class="f-sina"><a class="s-sina" data-cmd="tsina"></a></li>-->
<!--                                    <li class="f-qq" href="#"><i class="fa fa-qq"></i></li>-->
<!--                                    <li class="f-qzone"><a class="s-qzone" data-cmd="qzone"></a></li>-->
<!--                                </ul>-->
<!--                            </div>-->
<!--                            <div class="f-cb"></div>-->
<!--                            <div class="mt20 f-fwn fs-24 fc-grey comment" style="border-top: 1px solid #e1e2e0; padding-top: 20px;">-->
<!--                            </div>-->
<!--                            <fieldset class="layui-elem-field layui-field-title">-->
<!--                                <legend>发表评论</legend>-->
<!--                                <div class="layui-field-box">-->
<!--                                    <div class="leavemessage" style="text-align:initial">-->
<!--                                        <form class="layui-form blog-editor" action="">-->
<!--                                            <input type="hidden" name="articleid" id="articleid" value="@Model.ID">-->
<!--                                            <div class="layui-form-item">-->
<!--                                                <textarea name="editorContent" lay-verify="content" id="remarkEditor" placeholder="请输入内容" class="layui-textarea layui-hide"></textarea>-->
<!--                                            </div>-->
<!--                                            <div class="layui-form-item">-->
<!--                                                <button class="layui-btn" lay-submit="formLeaveMessage" lay-filter="formLeaveMessage">提交留言</button>-->
<!--                                            </div>-->
<!--                                        </form>-->
<!--                                    </div>-->
<!--                                </div>-->
<!--                            </fieldset>-->
                            <ul class="blog-comment" id="blog-comment"></ul>
                        </section>
                    </article>
                </div>
            </div>
        </div>
    </div>
    <footer class="grid-footer">
        <div class="footer-fixed">
            <div class="copyright">
                <div class="info">
<!--                    <div class="contact">-->
<!--                        <a href="javascript:void(0)" class="github" target="_blank"><i class="fa fa-github"></i></a>-->
<!--                        <a href="#" class="qq" target="_blank" ><i class="fa fa-qq"></i></a>-->
<!--                        <a href="#" class="email" target="_blank" ><i class="fa fa-envelope"></i></a>-->
<!--                        <a href="javascript:void(0)" class="weixin"><i class="fa fa-weixin"></i></a>-->
<!--                    </div>-->
                    <p class="mt05">
                        Copyright &copy; 2024-2025 CBT个人博客
                    </p>
                </div>
            </div>
        </div>
    </footer>
    <script src="layui/layui.js"></script>
    <script src="js/yss/gloable.js"></script>
    <script src="js/plugins/nprogress.js"></script>
    <script src="js/pagecomment.js"></script>
    <script src="js/jquery-3.6.0.js"></script>
    <script src="js/vue.js"></script>
    <script>NProgress.start();</script>
    <script> 
        window.onload = function () {
            NProgress.done();
        };

        let cbt = new Vue({
            el:".cbt",
            data:{
                blog:{},
                files:[]
            },
            mounted(){
                let id = localStorage.getItem("id");
                if(id == null || id == ""){
                    location.href="bgIndex.html";
                }
                $.post("/blog/getBlogInfo",{id:id},rt=>{
                    console.log(rt)
                        this.blog = rt.data
                        let nowWidth = $(".col-content").width() - 50;
                        if(nowWidth <= 500){
                            this.blog.define1 =  this.blog.define1.replace(/<img/g, "<img style='height:auto;width:" + nowWidth + "px'")
                            this.blog.define1 =  this.blog.define1.replace(/<span/g, "<span style='height:auto;width:" + nowWidth + "px'")
                            this.blog.define1 =  this.blog.define1.replace(/<div/g, "<div style='height:auto;width:" + nowWidth + "px'")
                            this.blog.define1 =  this.blog.define1.replace(/<table/g, "<table border='1 ' style='border:1px solid black; height:82px; padding:0px;width:" + nowWidth + "px'")
                        }else{
                            this.blog.define1 =  this.blog.define1.replace(/<img/g, "<img style='height:auto;width:" + nowWidth + "px'")
                        }
                        if(this.blog.fileNames != "" || this.blog.fileNames != null){
                            if(this.blog.fileNames.indexOf(";") == -1){
                                this.files.push(this.blog.fileNames)
                            }else{
                                let files = this.blog.fileNames.split(";")
                                files.forEach(item=>{
                                    this.files.push(item)
                                })
                            }

                        }
                },"json")
            },
            methods:{
                downLoadFile(tender){
                    let str = "/file/downLoadFile?fileNames=" + tender
                    const a = document.createElement("a");
                    a.style.display = "none";
                    a.href = str;
                    a.rel = "noopener noreferrer";
                    document.body.append(a);
                    a.click();
                },
            }
        })
    </script>
</body>
</html>
